package com.xingzhe.pengji.security.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xingzhe.pengji.security.dao.AuthoritieDao;
import com.xingzhe.pengji.security.domain.Authoritie;
import com.xingzhe.pengji.security.services.AuthoritieService;

@Service("authoritieService")
public class AuthoritieServiceImpl<T extends Authoritie> implements AuthoritieService<T> {
	@Autowired
	private AuthoritieDao<T> authoritieDao;

	@Override
	public void addAuthoritie(T t) {
		this.authoritieDao.addAuthoritie(t);
	}

	@Override
	public void delAuthoritie(T t) {
		this.authoritieDao.delAuthoritie(t);
	}

	@Override
	public void updateAuthoritie(T t) {
		this.authoritieDao.updateAuthoritie(t);
	}

	@Override
	public Authoritie findAuthoritieById(String id) {
		return this.authoritieDao.findAuthoritieById(id);
	}

	@Override
	public List<?> getAllAuthoritieNameByUserName(String userName) {
		return this.authoritieDao.getAllAuthoritieNameByUserName(userName);
	}

    @SuppressWarnings("unchecked")
    @Override
    public List<String> getAllAuthoritieName()
    {
        return (List<String>) authoritieDao.getAllAuthoritieName();
    }
	
}
